<?php

namespace App\Http\Controllers\admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DB;

class FootController extends Controller
{
    //
        public function index()
    {
		$m=DB::table('foot')->get();	
    	return view('admin.foot.index',['list'=>$m]);

    }
     public function destroy($id)
    {
    	// dd($id);
    	$m = DB::table('foot')->where('goodsid',$id)->delete();
    	if ($m>0) {
    		return redirect('/admin/foot');
    	}
    }
    // public function __construct(Request $request)
    // {
    // 	$id = $request->session()->get('homeuser')->userid;
    // 	$row = DB::table('foot')->where('userid',$id)->count();
    // 	dd($id); 
    // 	if ($m>25) {
    // 		$m = DB::table('foot')->where('userid',$id)->delete();
    // 		return redirect('/admin/foot');
    // 	}else{
    // 		return redirect('/admin/foot');
    // 	}
    // }
}
